﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.MainModule.Entities;
using Domain.Core.Specification;

namespace Domain.MainModule.GroupBranches
{
    public class GroupBranchGroupBranchIdSpecification: Specification<GroupBranch>
    {
        private Guid _groupBranchId;

        public GroupBranchGroupBranchIdSpecification(Guid groupBranchId)
        {
            this._groupBranchId = groupBranchId;
        }


        public override System.Linq.Expressions.Expression<Func<GroupBranch, bool>> SatisfiedBy()
        {
            Specification<GroupBranch> spec = new TrueSpecification<GroupBranch>();

            spec &= new DirectSpecification<GroupBranch>(c => c.GroupBranchId == this._groupBranchId);

            return spec.SatisfiedBy();

        }
    }
}
